<template>
	<view class="mainpadding2" v-if="pageShow">
		<view class="mainpadding_top ffffff radius" v-for="item in list.data" :key="item.id">
			<view class="pdl flexbetween">
				<view class="titletext hei_text bold">{{item.createtime_text}}</view>
				<view class="nosmalltext bold main_size" style="color: #ff0000;" v-show="item.status==1">待处理</view>
				<view class="nosmalltext bold main_size" style="color: #9e8d5e;" v-show="item.status==2">已处理</view>
			</view>
			<view :class="item.status==2?'pdl':''">
				<view class="margin_top hei_text bold main_size">城市：{{item.cityinfo}}</view>
				<view class="margin_top hei_text bold main_size">类型：{{item.type.name}}</view>
				<view class="margin_top hei_text bold main_size">内容：{{item.content}}</view>
			</view>
			<view class="margin_top nosmalltext" v-if="item.status==2" style="color: #14c464;">回复：{{item.notes}}</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				page: 1,
				limit: 12,
				list: {
					data: []
				},
				pageShow:false
			}
		},
		onShow() {
			this.init()
		},
		methods: {
			init(isPage, page) {
				let _this = this;
				httpRequest.request('/api/user/KfyjhzIndex', 'GET', {
					page: page || 1,
					limit: _this.limit,
				}, false, false, true).then(res => {
					if (res.code == 1) {
						let resList = res.data;
						let dataList = _this.list;
						if (isPage == true) {
							_this.list.data = dataList.data.concat(resList.data);
						} else {
							this.list = res.data
							_this.list.data = resList.data;
							this.pageShow = true
						}
					}

				})
			},
			onReachBottom() {
				let _this = this;
				let list = _this.list;
				let page = _this.page;
				if (list.last_page <= page) {
					return false;
				}
				page++;
				_this.page = page;
				_this.init(true, page);
			},
		}
	}
</script>

<style>

</style>